'''
======================
@author:SUNLIN
@time:2025/3/3 18:39
@email:1232@163.com
======================
'''

str1 = "abc"
int1 = 123
float1 = 3.1415926
bool = True

# 1. 创建数据容器
print('==1. 创建数据容器===')
list1 = [str1, int1, float1, bool,str1,int1,float1,bool]
set1 = {str1, int1, float1, bool,str1,int1,float1,bool}
dict1 = {
    'string': str1,
    'int': int1,
    'float': float1}

# 2. 打印、查看数据类型
print('===2. 打印、查看数据类型===')
print(list1)
print(set1)
print(dict1)
print(type(list1))
print(type(set1))
print(type(dict1))

# 3. 转换数据类型
print('===3. 转换数据类型===')
print(int(float1))
## list to set
print(set(list1))
## set to set
print(list(set1))


# 4. 查找数据
print('===4. 查找数据===')
print(list1[3])
## 查找set中的数据之先转为list列表
print(list(set1)[3])
print(dict1.get('string'))

print('===5. 更新数据===')
print(list1.append('append'))
print(list1.append('append'))
print(list1.append('append'))
print(list1)
print(list1.remove('append'))## 只会删除一个相同的数据
print(list1)

dict1['key'] = 'append'
print(dict1)
del dict1['key']
print(dict1)













